<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title>个人信息</title>
	<link rel="stylesheet" href="../css/gerenxinxi.css" />
</head>
<script src="../js/jquery-3.2.1.min.js"></script>
<script type="text/javascript">
	$(function(){
		var token = window.sessionStorage.token;
		$.ajax({
			type: "post",
			contentType: "application/json",
			url:"http://localhost:8888/user/userInfo",
			async:false,
			headers:{'Content-Type':'application/json;charset=utf8','token':token},
			success:function(data){
				if(data.code==1){
					var userInfo = data.data;
					$("#name").text(userInfo.name);
					$("#nickName").text(userInfo.name);
					$("#phone").text(userInfo.phone);
					if(userInfo.sex == 1){
						$("#sex").text("男");
					}else{
						$("#sex").text("女");
					}
					$("#number").text(userInfo.number);
					$("#email").text(userInfo.email);
				}else{
					alert(data.message);
				}
				
			},error:function(data){
				alert(data.message);
			}
		});
	})

</script>

<body>
	<div class="view-container">
		<div class="view-cont">
			<h3>个人信息</h3>
			<div class="view-list">
				<ul class="view-ul">
					<li class="view-li">姓名：<span id="name"></span></li>
					<li class="view-li">用户名：<span id="nickName" ></span></li>
					<li class="view-li">性别：<span id="sex"></span></li>
					<li class="view-li">手机号：<span id="phone"></span></li>
					<li class="view-li">证件号：<span id="number"></span></li>
					<li class="view-li">邮箱：<span id="email"></span></li>
				</ul>
			</div>
		</div>
	</div>
</body>
</html>
